package sany.iec.config;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.openmuc.j60870.Server;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author : 托马斯
 * @Date : 2025/7/3 20:00
 * @Description :
 */
@Configuration
@Slf4j
@Getter
public class IecOlp02Server {

    @Value("${iec.olp02.port}")
    private int port;

    @Bean(name = "Olp02Server")
    public Server server() {
        Server server = Server.builder().setPort(port).build();
        log.info("Iec104Server OLP01 Server started on port {}", port);
        return server;
    }

}
